import React, { lazy, Suspense } from "react";
import { createRoot } from "react-dom/client";
import { HashRouter as Router, Routes, Route } from "react-router-dom";

import AppProvider from "./components/AppProvider";


// 组件文件引入中文语言包
import zhCN from "antd/es/locale/zh_CN";
// 进行国际化配置
import { ConfigProvider } from "antd";

// import Layouts from "./view/Layouts";
import App from "./App";
import Login from "./view/login/Login.jsx";
const NotFound = lazy(() => import("./view/notFound/NotFound.jsx"));

const root = createRoot(document.getElementById("root"));
root.render(
  <AppProvider>
    <ConfigProvider locale={zhCN}>
      <Router>
        <Routes>
          <Route path="/" element={<Login />} />
          <Route path="/layouts/*" element={<App />} />
          {/* 或者跳转到 NotFound */}
          <Route path="*" element={<NotFound />} />
        </Routes>
      </Router>
    </ConfigProvider>
  </AppProvider>
);
